package com.zijidelu.luframework.plugins.tomlock.core.data;

import com.zijidelu.luframework.plugins.tomlock.core.exception.TomLockException;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

/**
 * 分布式锁方法数据
 *
 * @author ZIJIDELU
 * @datetime 2025/4/20 01:39
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class TomLockMethodData extends TomLockData {
    /**
     * 模块
     */
    private String module;

    /**
     * 业务
     */
    private String business;

    @Override
    public void validParams() {
        if (StringUtils.isBlank(module)) {
            throw new TomLockException("模块不能为空");
        }

        if (StringUtils.isBlank(business)) {
            throw new TomLockException("业务不能为空");
        }
    }
}
